home *** CD-ROM | disk | FTP | other *** search
/ Computer Arts: Pro Software Skills - Photoshop / Computer Arts Pro Software Skills Photoshop.iso / pc / main.swf / scripts / DefineSprite_58 / frame_1 / DoAction.as
Encoding:
Text File  |  2011-06-06  |  2.2 KB  |  86 lines

  1. stop();
  2. var myResourcesLoader = new LoadVars();
  3. var myPath = "";
  4. var imClicked = false;
  5. myResourcesLoader.onData = function(dat)
  6. {
  7.    trace(dat);
  8.    if(dat.indexOf("link") != -1)
  9.    {
  10.       trace("LINK DETECTED");
  11.       trace("Loading Link Image at: " + myPath + "shot.jpg");
  12.       _root.loadPictures(myPath,Array("/shot.jpg"));
  13.    }
  14.    else if(dat.indexOf("folder") == -1)
  15.    {
  16.       resources = dat.split("-");
  17.       resources.shift();
  18.       r = 0;
  19.       while(r < resources.length)
  20.       {
  21.          resources[r] = resources[r].indexOf("\n") == -1 ? resources[r] : resources[r].slice(0,-2);
  22.          r++;
  23.       }
  24.       trace("resource Loaded");
  25.       if(dat.indexOf(".flv") != -1)
  26.       {
  27.          trace(resources);
  28.          _root.setVideoResourcesList(resources);
  29.          _root.setVideoPath(myPath);
  30.          _root.loadVideo(resources,0);
  31.       }
  32.       else
  33.       {
  34.          _root.loadPictures(myPath,resources);
  35.       }
  36.    }
  37.    else
  38.    {
  39.       paths = dat.split("-");
  40.       paths.shift();
  41.       plat = System.capabilities.os;
  42.       pcPath = "";
  43.       macPath = "";
  44.       p = 0;
  45.       while(p < paths.length)
  46.       {
  47.          if(paths[p].toLowerCase().indexOf("mac") != -1)
  48.          {
  49.             macPath = paths[p].split("=")[1];
  50.          }
  51.          else
  52.          {
  53.             pcPath = myPath + _global.delim + paths[p].split("=")[1];
  54.          }
  55.          if(plat.toLowerCase().indexOf("win") != -1)
  56.          {
  57.             _root.setOpenFolder(pcPath,0);
  58.          }
  59.          else
  60.          {
  61.             _root.setOpenFolder(macPath,1);
  62.          }
  63.          _root.loadPictures(myPath,Array("shot.jpg"));
  64.          p++;
  65.       }
  66.    }
  67. };
  68. this.onRelease = function()
  69. {
  70.    trace(this.pPath);
  71.    if(!imClicked)
  72.    {
  73.       _root.openFolderButton._visible = false;
  74.       _root.openFolderMacPathIndicator._visible = false;
  75.       _root.unClickActiveItems();
  76.       imClicked = true;
  77.       this.gotoAndStop(2);
  78.       _root.stopVideo();
  79.       cPath = mdm.Application.path + "discContents" + _global.delim + this.secPath + _global.delim + this.pPath;
  80.       myPath = cPath;
  81.       _root.loadInfoText(cPath);
  82.       _root.setMainTitle(this.iName);
  83.       myResourcesLoader.load(cPath + _global.delim + "resources.txt");
  84.    }
  85. };
  86.